#ifndef _STRATEGY_H_
#define _STRATEGY_H_

#include <iostream>
using namespace std;

class WeaponStrategy
{
public:
    virtual void UseWeapon() = 0;
};

class Knife : public WeaponStrategy
{
public:
    virtual void UseWeapon() {
        cout << "use Knife" << endl;
    }
};

class AK47 : public WeaponStrategy
{
public:
    virtual void UseWeapon() {
        cout << "use AK47" << endl;
    }
};

class Character
{
public:
    WeaponStrategy* _pWeapon;
    void SetWeapon(WeaponStrategy* pWeapon) {
        cout << "Chararter::SetWeapon()" << endl;
        _pWeapon = pWeapon;
    }

    void ThrowWeapon() {
        cout << "Character::ThrowWeapon()" << endl;
        _pWeapon->UseWeapon();
    }
};

#endif // _STRATEGY_H_